#ifdef __cplusplus
extern "C"{
#endif

#ifndef PRINT
#define PRINT

extern const int num10s[];

struct Stream{
  int (*getc)(struct Stream*);
  void (*putc)(struct Stream*,int);
  void (*putcgb)(struct Stream*,int,int);
  void* obj;
};

void putc(int);
int getc();

void setDefaultStream(struct Stream*);
void print(const char* str);
void sprint(struct Stream* stream, const char* str);

//int printLen(const char* str, int len);
//void printgb(const char*);
void printByte(int);
void sprintByte(struct Stream*, int);
void printHex(int);
void sprintHex(struct Stream*, int);
//void printBin(int);
void printInt(int val);
void sprintInt(struct Stream*, int);
void printDouble(double v);
void sprintDouble(struct Stream*, double);

int equal(const char* a,const  char* b, int maxlen);
int scan(char* buff, int maxlen);
int toBcd(int val);
int scanInt();
int scanByte();
int getByte(char* chr);
double scanDouble();

#endif

#ifdef __cplusplus
}
#endif
